package barbershop;

public class Client {
	private int totalTime;
	private int shaveTime;
	private boolean shaving;
	private String name;
	
	public String getName() { return name; }

	public Client(int shaveTime, String name) {
		this.shaveTime = shaveTime;
		this.name = name;
		shaving = false;
	}
	
	public int timeLeft() { // Time left to shave's over (-1 = infinite)
		if (!shaving) return -1;
		else return shaveTime;
	}
	
	public int timeElapsed() { // Time elapsed since the client arrives the shop
		return totalTime;
	}
	
	public void clientWait() { // Makes the client wait
		totalTime++;
	}
	
	public void clientShave() { // Shaves the client a single step
		shaving = true;
		totalTime++;
		shaveTime--;
	}
}
